﻿using WebCommon.Com;

namespace WebCommon.Api
{
    /// <summary>
    /// GEtJson
    /// </summary>

    public class SubGet : SubBase
    {
        
        protected override bool IsSuids(string key)
        {
            if (this.IsValidate)
            {
                var m = this.Check;
                var keyValuePairs = Static.GetObjNameValue(this,false, "SubBase");
                var datastr = Static.GetOrderBy(keyValuePairs);
                var datakeyStr = $"{datastr}&Key={key}";
                var md5 = Encryption.Md532(datakeyStr);

                var b = m == md5;
                if (b)
                {
                    return true;
                }
                else
                {
                    this.Msg = $"加密错误,Md5={md5},加密数据={datakeyStr}";
                    return false;
                }

            }

            return false;
        } 
    }
}